package mysqlinit

import "gorm.io/gorm"

type RealNameAuth struct {
	gorm.Model
	UserId int64 `gorm:"type:int(11);not null"`

	RealName string `gorm:"type:varchar(12);not null"`

	IdCord string `gorm:"type:varchar(18);not null"`
}

func (r *RealNameAuth) GetRealNameAuthInfo(userId int64, realName string) error {
	return DB.Where("user_id = ? or real_name = ?", userId, realName).Limit(1).Find(&r).Error
}

func (r *RealNameAuth) CreateReal() error {
	return DB.Create(&r).Error
}
